package com.xiaozhu.enumreation;

/**
 * @author 朱慧军
 * @version 1.0
 */
public enum ChatTypeEnum {

    CHAT_TYPE_ENUM(1, "普通聊天逻辑"),

    PDF_TYPE_ENUM(2, "PDF文件读取逻辑"),

    ROMANCE_TYPE_ENUM(3, "恋爱模拟器逻辑");

    private final int code;

    private final String chatType;

    ChatTypeEnum(int code, String chatType){
        this.code = code;
        this.chatType = chatType;

    }

    public String getChatType(){
        return chatType;
    }

    public int getCode(){
        return code;
    }

    public static ChatTypeEnum fromCode(int code){
        for(ChatTypeEnum e : values()){
            if (e.code == code){
                return e;
            }
        }
        return null; // 或抛异常
    }






}
